<script type="text/javascript">
    function showProductImage(filename) {
    	var l = (screen.availWidth/2)-350;
    	var t = (screen.availHeight/2)-300;
    	window.open('<?php echo $this->baseUrl('/public/files/product/'); ?>'+filename, "imagePop", "toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=500,height=500,top="+t+",left="+l);
        return false;
    }
</script>
<?php $common = new Admincp_Model_Common(); ?>
<div class="main-blocks">
    <div class="heading-main-blocks">
        <h4>Chi tiết sản phẩm</h4>
    </div>
    
    <div class="content-main-blocks">
        <span class="title-detail"><?php echo $this->data['name']; ?></span>
        <table class="wapper-table" cellpadding="0" cellspacing="0">
            <td style="width: 240px; text-align: center;">
                <a href="" class="link-click" onclick="return showProductImage('<?php echo $this->data['image']; ?>')">
                    <img src="<?php echo $this->baseUrl('/public/files/product/').$this->data['image']; ?>" width="240px" height="192px" title="Nhấn vào để phóng to" />
                </a>
                <div class="click-to-resize-image">
                    <a href="" onclick="return showProductImage('<?php echo $this->data['image']; ?>')">Nhấn để phóng to</a>
                </div>
            </td>
            <td>
                <table class="table-content" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 125px;">Mã sản phẩm</td>
                        <td><?php echo $this->data['code']; ?></td>
                    </tr>
                    <tr>
                        <td>Giá chưa VAT</td>
                        <td><b><?php echo $common->formatMoney($this->data['price'].'000'); ?> VNĐ</b></td>
                    </tr>
                    <tr>
                        <td>Giá có VAT 10%</td>
                        <td><b style="color: red;"><?php echo $common->formatMoney($this->data['price_vat'].'000'); ?> VNĐ (Phải tính thuế VAT)</b></td>
                    </tr>
                    <tr>
                        <td>Kích thước</td>
                        <td><b><?php echo ($this->data['size'] != '') ? $this->data['size'] : '&nbsp;'; ?></b></td>
                    </tr>
                    <tr>
                        <td>Mô tả</td>
                        <td><?php echo $this->data['description']; ?></td>
                    </tr>
                    <tr>
                        <td>Thương hiệu</td>
                        <td><?php echo $this->data['provider_name']; ?></td>
                    </tr>
                    <tr>
                        <td>
                            <div class="add-cart-detail">
                                <a href="">Mua hàng</a>
                            </div>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </td>
        </table>
    </div>
</div>
<!-- End .main-blocks -->

<?php if(count($this->dataConnect) > 0) : ?>
<div class="main-blocks">
    <div class="heading-main-blocks">
        <h4>Sản phẩm cùng loại</h4>
    </div>
    
    <div class="content-main-blocks">
    <?php foreach($this->dataConnect as $value) : ?>
        <div class="product">
            <div class="product-title">
                <a href="<?php echo $this->url(array('action'=>'detail','controller'=>'product','module'=>'default','title'=>$value['url'],'id'=>$value['id']),'product'); ?>">
                    <?php echo $value['name']; ?>
                </a>
            </div>
            
            <a class="product-image" href="<?php echo $this->url(array('action'=>'detail','controller'=>'product','module'=>'default','title'=>$value['url'],'id'=>$value['id']),'product'); ?>">
                <img src="<?php echo $this->baseUrl('/public/files/product/thumbnail/').$value['thumbnail']; ?>" onmouseover="Tip('<table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td align=center><strong><?php echo $value['name']; ?></strong></td></tr><tr><td align=left><img src=<?php echo $this->baseUrl('/public/files/product/').$value['image']; ?> width=400 /></td></tr></table>', WIDTH, 400, ABOVE, true, OFFSETX, 1, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()"/>
            </a>
            
            <div class="price">
                <p class="product-weight"><?php echo ($value['size'] != '') ? $value['size'] : '&nbsp;'; ?></p>
                <p class="product-original-price">Chưa VAT: <?php echo $common->formatMoney($value['price'].'000'); ?> VNĐ</p>
                <p class="product-sales-price"><span class="error-msg">Có VAT 10%: <?php echo $common->formatMoney($value['price_vat'].'000'); ?> VNĐ</span></p>
            </div>
            
            <div class="add-cart">
                <a href="">Mua hàng</a>
            </div>
        </div>
        <!-- End .product -->
    <?php endforeach; ?>
    </div>
</div>
<!-- End .main-blocks -->
<?php endif; ?>